package com.neuedu.web;

import com.neuedu.pojo.AdminTable;
import com.neuedu.pojo.Declaration;
import com.neuedu.pojo.Result;
import com.neuedu.pojo.RoleTable;
import com.neuedu.service.DeclarationService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/Declaration")
@Tag(name="自主申报信息")
public class DeclarationController {
    @Resource
    private DeclarationService declarationService;
    @PostMapping("/addDeclaration")
    public Result<Void> addDeclaration(@RequestBody Declaration declaration) {
        return this.declarationService.addDeclaration(declaration);
    }

    @GetMapping("/id")
    public Result<Declaration> getDeclarationByFid(Integer fid) {
        return this.declarationService.getDeclarationByFid(fid);
    }
    @DeleteMapping("/deleteDeclaration")
    public Result<Void> deleteDeclaration(Integer id) {
        return this.declarationService.deleteDeclaration(id);
    }
    @PutMapping("/updateDeclaration")
    public Result<Void> updateDeclaration(@RequestBody Declaration declaration) {
        return this.declarationService.updateDeclaration(declaration);
    }
    @GetMapping("/selectDeclarationByCard")
    public Result<Integer> selectDeclarationByCard(@RequestParam(name = "card")String card) {
        return this.declarationService.selectDeclarationByCard(card);
    }


}
